/*********************************************************
          File Name:16.40.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 19 Dec 2015 07:42:01 PM CST
**********************************************************/

//Q: whether the following function legitimate? if not, why?
// if it's legal, is there any limitation? what's the return type?

/*
template<typename T>
auto fcn(T beg, T end) -> decltype(*beg + 0)
{
        return *beg;
}
*/

// A: it's legal, but we must ensure the arguments have the implementation
// for `operator+`, and the return type is the reference of `beg`
